package com.blb.educourseservice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.educourseservice.mapper.CourseMapper;
import com.blb.educourseservice.service.ICourseService;
import com.blb.pojo.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> implements ICourseService {
    @Autowired
    private CourseMapper courseMapper;

    @Override
    public List<Course> getAllCourses() {
        List<Course> courses = courseMapper.selectAllCourses();
        return courses;
    }

    @Override
    public Course getCourseDetailsById(Long id) {
        return courseMapper.selectCourseDetailsById(id);
    }

    @Override
    public Course getCourseById(Long id) {
        Course course = courseMapper.selectCourseById(id);
        return course;
    }
}
